<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - iris.info - /usr/include/c++/4.3/bits/stl_vector.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../../../index.html">directory</a> - <a href="index.html">usr/include/c++/4.3/bits</a> - stl_vector.h</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>iris.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-05-24</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">99</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">63.6 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">63</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : // Vector implementation -*- C++ -*-
<span class="lineNum">       2 </span>                : 
<span class="lineNum">       3 </span>                : // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
<span class="lineNum">       4 </span>                : // Free Software Foundation, Inc.
<span class="lineNum">       5 </span>                : //
<span class="lineNum">       6 </span>                : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       7 </span>                : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       8 </span>                : // terms of the GNU General Public License as published by the
<span class="lineNum">       9 </span>                : // Free Software Foundation; either version 2, or (at your option)
<span class="lineNum">      10 </span>                : // any later version.
<span class="lineNum">      11 </span>                : 
<span class="lineNum">      12 </span>                : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      13 </span>                : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      14 </span>                : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      15 </span>                : // GNU General Public License for more details.
<span class="lineNum">      16 </span>                : 
<span class="lineNum">      17 </span>                : // You should have received a copy of the GNU General Public License along
<span class="lineNum">      18 </span>                : // with this library; see the file COPYING.  If not, write to the Free
<span class="lineNum">      19 </span>                : // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
<span class="lineNum">      20 </span>                : // USA.
<span class="lineNum">      21 </span>                : 
<span class="lineNum">      22 </span>                : // As a special exception, you may use this file as part of a free software
<span class="lineNum">      23 </span>                : // library without restriction.  Specifically, if other files instantiate
<span class="lineNum">      24 </span>                : // templates or use macros or inline functions from this file, or you compile
<span class="lineNum">      25 </span>                : // this file and link it with other files to produce an executable, this
<span class="lineNum">      26 </span>                : // file does not by itself cause the resulting executable to be covered by
<span class="lineNum">      27 </span>                : // the GNU General Public License.  This exception does not however
<span class="lineNum">      28 </span>                : // invalidate any other reasons why the executable file might be covered by
<span class="lineNum">      29 </span>                : // the GNU General Public License.
<span class="lineNum">      30 </span>                : 
<span class="lineNum">      31 </span>                : /*
<span class="lineNum">      32 </span>                :  *
<span class="lineNum">      33 </span>                :  * Copyright (c) 1994
<span class="lineNum">      34 </span>                :  * Hewlett-Packard Company
<span class="lineNum">      35 </span>                :  *
<span class="lineNum">      36 </span>                :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      37 </span>                :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      38 </span>                :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      39 </span>                :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      40 </span>                :  * in supporting documentation.  Hewlett-Packard Company makes no
<span class="lineNum">      41 </span>                :  * representations about the suitability of this software for any
<span class="lineNum">      42 </span>                :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      43 </span>                :  *
<span class="lineNum">      44 </span>                :  *
<span class="lineNum">      45 </span>                :  * Copyright (c) 1996
<span class="lineNum">      46 </span>                :  * Silicon Graphics Computer Systems, Inc.
<span class="lineNum">      47 </span>                :  *
<span class="lineNum">      48 </span>                :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      49 </span>                :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      50 </span>                :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      51 </span>                :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      52 </span>                :  * in supporting documentation.  Silicon Graphics makes no
<span class="lineNum">      53 </span>                :  * representations about the suitability of this  software for any
<span class="lineNum">      54 </span>                :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      55 </span>                :  */
<span class="lineNum">      56 </span>                : 
<span class="lineNum">      57 </span>                : /** @file stl_vector.h
<span class="lineNum">      58 </span>                :  *  This is an internal header file, included by other library headers.
<span class="lineNum">      59 </span>                :  *  You should not attempt to use it directly.
<span class="lineNum">      60 </span>                :  */
<span class="lineNum">      61 </span>                : 
<span class="lineNum">      62 </span>                : #ifndef _STL_VECTOR_H
<span class="lineNum">      63 </span>                : #define _STL_VECTOR_H 1
<span class="lineNum">      64 </span>                : 
<span class="lineNum">      65 </span>                : #include &lt;bits/stl_iterator_base_funcs.h&gt;
<span class="lineNum">      66 </span>                : #include &lt;bits/functexcept.h&gt;
<span class="lineNum">      67 </span>                : #include &lt;bits/concept_check.h&gt;
<span class="lineNum">      68 </span>                : 
<span class="lineNum">      69 </span>                : _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
<span class="lineNum">      70 </span>                : 
<span class="lineNum">      71 </span>                :   /// See bits/stl_deque.h's _Deque_base for an explanation.
<span class="lineNum">      72 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">      73 </span>                :     struct _Vector_base
<span class="lineNum">      74 </span>                :     {
<span class="lineNum">      75 </span>                :       typedef typename _Alloc::template rebind&lt;_Tp&gt;::other _Tp_alloc_type;
<span class="lineNum">      76 </span>                : 
<span class="lineNum">      77 </span>                :       struct _Vector_impl 
<span class="lineNum">      78 </span>                :       : public _Tp_alloc_type
<span class="lineNum">      79 </span><span class="lineCov">       44668687 :       {</span>
<span class="lineNum">      80 </span>                :         _Tp*           _M_start;
<span class="lineNum">      81 </span>                :         _Tp*           _M_finish;
<span class="lineNum">      82 </span>                :         _Tp*           _M_end_of_storage;
<span class="lineNum">      83 </span>                : 
<span class="lineNum">      84 </span><span class="lineNoCov">              0 :         _Vector_impl()</span>
<span class="lineNum">      85 </span><span class="lineCov">       89332122 :         : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)</span>
<span class="lineNum">      86 </span><span class="lineNoCov">              0 :         { }</span>
<span class="lineNum">      87 </span>                : 
<span class="lineNum">      88 </span><span class="lineNoCov">              0 :         _Vector_impl(_Tp_alloc_type const&amp; __a)</span>
<span class="lineNum">      89 </span><span class="lineCov">           6656 :         : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)</span>
<span class="lineNum">      90 </span><span class="lineNoCov">              0 :         { }</span>
<span class="lineNum">      91 </span>                :       };
<span class="lineNum">      92 </span>                :       
<span class="lineNum">      93 </span>                :     public:
<span class="lineNum">      94 </span>                :       typedef _Alloc allocator_type;
<span class="lineNum">      95 </span>                : 
<span class="lineNum">      96 </span>                :       _Tp_alloc_type&amp;
<span class="lineNum">      97 </span><span class="lineNoCov">              0 :       _M_get_Tp_allocator()</span>
<span class="lineNum">      98 </span><span class="lineCov">       91008071 :       { return *static_cast&lt;_Tp_alloc_type*&gt;(&amp;this-&gt;_M_impl); }</span>
<span class="lineNum">      99 </span>                : 
<span class="lineNum">     100 </span>                :       const _Tp_alloc_type&amp;
<span class="lineNum">     101 </span><span class="lineNoCov">              0 :       _M_get_Tp_allocator() const</span>
<span class="lineNum">     102 </span><span class="lineCov">       23408524 :       { return *static_cast&lt;const _Tp_alloc_type*&gt;(&amp;this-&gt;_M_impl); }</span>
<span class="lineNum">     103 </span>                : 
<span class="lineNum">     104 </span>                :       allocator_type
<span class="lineNum">     105 </span>                :       get_allocator() const
<span class="lineNum">     106 </span>                :       { return allocator_type(_M_get_Tp_allocator()); }
<span class="lineNum">     107 </span>                : 
<span class="lineNum">     108 </span><span class="lineNoCov">              0 :       _Vector_base()</span>
<span class="lineNum">     109 </span><span class="lineCov">       44666061 :       : _M_impl() { }</span>
<span class="lineNum">     110 </span>                : 
<span class="lineNum">     111 </span>                :       _Vector_base(const allocator_type&amp; __a)
<span class="lineNum">     112 </span>                :       : _M_impl(__a) { }
<span class="lineNum">     113 </span>                : 
<span class="lineNum">     114 </span><span class="lineCov">           3328 :       _Vector_base(size_t __n, const allocator_type&amp; __a)</span>
<span class="lineNum">     115 </span><span class="lineCov">           3328 :       : _M_impl(__a)</span>
<span class="lineNum">     116 </span>                :       {
<span class="lineNum">     117 </span><span class="lineCov">           3328 :         this-&gt;_M_impl._M_start = this-&gt;_M_allocate(__n);</span>
<span class="lineNum">     118 </span><span class="lineCov">           3328 :         this-&gt;_M_impl._M_finish = this-&gt;_M_impl._M_start;</span>
<span class="lineNum">     119 </span><span class="lineCov">           3328 :         this-&gt;_M_impl._M_end_of_storage = this-&gt;_M_impl._M_start + __n;</span>
<span class="lineNum">     120 </span><span class="lineCov">           3328 :       }</span>
<span class="lineNum">     121 </span>                : 
<span class="lineNum">     122 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     123 </span>                :       _Vector_base(_Vector_base&amp;&amp; __x)
<span class="lineNum">     124 </span>                :       : _M_impl(__x._M_get_Tp_allocator())
<span class="lineNum">     125 </span>                :       {
<span class="lineNum">     126 </span>                :         this-&gt;_M_impl._M_start = __x._M_impl._M_start;
<span class="lineNum">     127 </span>                :         this-&gt;_M_impl._M_finish = __x._M_impl._M_finish;
<span class="lineNum">     128 </span>                :         this-&gt;_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
<span class="lineNum">     129 </span>                :         __x._M_impl._M_start = 0;
<span class="lineNum">     130 </span>                :         __x._M_impl._M_finish = 0;
<span class="lineNum">     131 </span>                :         __x._M_impl._M_end_of_storage = 0;
<span class="lineNum">     132 </span>                :       }
<span class="lineNum">     133 </span>                : #endif
<span class="lineNum">     134 </span>                : 
<span class="lineNum">     135 </span><span class="lineCov">       44668687 :       ~_Vector_base()</span>
<span class="lineNum">     136 </span><span class="lineCov">      134006061 :       { _M_deallocate(this-&gt;_M_impl._M_start, this-&gt;_M_impl._M_end_of_storage</span>
<span class="lineNum">     137 </span><span class="lineCov">       44668687 :                       - this-&gt;_M_impl._M_start); }</span>
<span class="lineNum">     138 </span>                : 
<span class="lineNum">     139 </span>                :     public:
<span class="lineNum">     140 </span>                :       _Vector_impl _M_impl;
<span class="lineNum">     141 </span>                : 
<span class="lineNum">     142 </span>                :       _Tp*
<span class="lineNum">     143 </span><span class="lineCov">       11705926 :       _M_allocate(size_t __n)</span>
<span class="lineNum">     144 </span><span class="lineCov">       11705926 :       { return __n != 0 ? _M_impl.allocate(__n) : 0; }</span>
<span class="lineNum">     145 </span>                : 
<span class="lineNum">     146 </span>                :       void
<span class="lineNum">     147 </span><span class="lineNoCov">              0 :       _M_deallocate(_Tp* __p, size_t __n)</span>
<span class="lineNum">     148 </span>                :       {
<span class="lineNum">     149 </span><span class="lineCov">       56371285 :         if (__p)</span>
<span class="lineNum">     150 </span><span class="lineCov">       11702357 :           _M_impl.deallocate(__p, __n);</span>
<span class="lineNum">     151 </span><span class="lineNoCov">              0 :       }</span>
<span class="lineNum">     152 </span>                :     };
<span class="lineNum">     153 </span>                : 
<span class="lineNum">     154 </span>                : 
<span class="lineNum">     155 </span>                :   /**
<span class="lineNum">     156 </span>                :    *  @brief A standard container which offers fixed time access to
<span class="lineNum">     157 </span>                :    *  individual elements in any order.
<span class="lineNum">     158 </span>                :    *
<span class="lineNum">     159 </span>                :    *  @ingroup Containers
<span class="lineNum">     160 </span>                :    *  @ingroup Sequences
<span class="lineNum">     161 </span>                :    *
<span class="lineNum">     162 </span>                :    *  Meets the requirements of a &lt;a href=&quot;tables.html#65&quot;&gt;container&lt;/a&gt;, a
<span class="lineNum">     163 </span>                :    *  &lt;a href=&quot;tables.html#66&quot;&gt;reversible container&lt;/a&gt;, and a
<span class="lineNum">     164 </span>                :    *  &lt;a href=&quot;tables.html#67&quot;&gt;sequence&lt;/a&gt;, including the
<span class="lineNum">     165 </span>                :    *  &lt;a href=&quot;tables.html#68&quot;&gt;optional sequence requirements&lt;/a&gt; with the
<span class="lineNum">     166 </span>                :    *  %exception of @c push_front and @c pop_front.
<span class="lineNum">     167 </span>                :    *
<span class="lineNum">     168 </span>                :    *  In some terminology a %vector can be described as a dynamic
<span class="lineNum">     169 </span>                :    *  C-style array, it offers fast and efficient access to individual
<span class="lineNum">     170 </span>                :    *  elements in any order and saves the user from worrying about
<span class="lineNum">     171 </span>                :    *  memory and size allocation.  Subscripting ( @c [] ) access is
<span class="lineNum">     172 </span>                :    *  also provided as with C-style arrays.
<span class="lineNum">     173 </span>                :   */
<span class="lineNum">     174 </span>                :   template&lt;typename _Tp, typename _Alloc = std::allocator&lt;_Tp&gt; &gt;
<span class="lineNum">     175 </span>                :     class vector : protected _Vector_base&lt;_Tp, _Alloc&gt;
<span class="lineNum">     176 </span>                :     {
<span class="lineNum">     177 </span>                :       // Concept requirements.
<span class="lineNum">     178 </span>                :       typedef typename _Alloc::value_type                _Alloc_value_type;
<span class="lineNum">     179 </span>                :       __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
<span class="lineNum">     180 </span>                :       __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
<span class="lineNum">     181 </span>                :       
<span class="lineNum">     182 </span>                :       typedef _Vector_base&lt;_Tp, _Alloc&gt;                    _Base;
<span class="lineNum">     183 </span>                :       typedef vector&lt;_Tp, _Alloc&gt;                  vector_type;
<span class="lineNum">     184 </span>                :       typedef typename _Base::_Tp_alloc_type             _Tp_alloc_type;
<span class="lineNum">     185 </span>                : 
<span class="lineNum">     186 </span>                :     public:
<span class="lineNum">     187 </span>                :       typedef _Tp                                        value_type;
<span class="lineNum">     188 </span>                :       typedef typename _Tp_alloc_type::pointer           pointer;
<span class="lineNum">     189 </span>                :       typedef typename _Tp_alloc_type::const_pointer     const_pointer;
<span class="lineNum">     190 </span>                :       typedef typename _Tp_alloc_type::reference         reference;
<span class="lineNum">     191 </span>                :       typedef typename _Tp_alloc_type::const_reference   const_reference;
<span class="lineNum">     192 </span>                :       typedef __gnu_cxx::__normal_iterator&lt;pointer, vector_type&gt; iterator;
<span class="lineNum">     193 </span>                :       typedef __gnu_cxx::__normal_iterator&lt;const_pointer, vector_type&gt;
<span class="lineNum">     194 </span>                :       const_iterator;
<span class="lineNum">     195 </span>                :       typedef std::reverse_iterator&lt;const_iterator&gt;  const_reverse_iterator;
<span class="lineNum">     196 </span>                :       typedef std::reverse_iterator&lt;iterator&gt;              reverse_iterator;
<span class="lineNum">     197 </span>                :       typedef size_t                                     size_type;
<span class="lineNum">     198 </span>                :       typedef ptrdiff_t                                  difference_type;
<span class="lineNum">     199 </span>                :       typedef _Alloc                                     allocator_type;
<span class="lineNum">     200 </span>                : 
<span class="lineNum">     201 </span>                :     protected:
<span class="lineNum">     202 </span>                :       using _Base::_M_allocate;
<span class="lineNum">     203 </span>                :       using _Base::_M_deallocate;
<span class="lineNum">     204 </span>                :       using _Base::_M_impl;
<span class="lineNum">     205 </span>                :       using _Base::_M_get_Tp_allocator;
<span class="lineNum">     206 </span>                : 
<span class="lineNum">     207 </span>                :     public:
<span class="lineNum">     208 </span>                :       // [23.2.4.1] construct/copy/destroy
<span class="lineNum">     209 </span>                :       // (assign() and get_allocator() are also listed in this section)
<span class="lineNum">     210 </span>                :       /**
<span class="lineNum">     211 </span>                :        *  @brief  Default constructor creates no elements.
<span class="lineNum">     212 </span>                :        */
<span class="lineNum">     213 </span><span class="lineNoCov">              0 :       vector()</span>
<span class="lineNum">     214 </span><span class="lineCov">       44666061 :       : _Base() { }</span>
<span class="lineNum">     215 </span>                : 
<span class="lineNum">     216 </span>                :       /**
<span class="lineNum">     217 </span>                :        *  @brief  Creates a %vector with no elements.
<span class="lineNum">     218 </span>                :        *  @param  a  An allocator object.
<span class="lineNum">     219 </span>                :        */
<span class="lineNum">     220 </span>                :       explicit
<span class="lineNum">     221 </span>                :       vector(const allocator_type&amp; __a)
<span class="lineNum">     222 </span>                :       : _Base(__a) { }
<span class="lineNum">     223 </span>                : 
<span class="lineNum">     224 </span>                :       /**
<span class="lineNum">     225 </span>                :        *  @brief  Creates a %vector with copies of an exemplar element.
<span class="lineNum">     226 </span>                :        *  @param  n  The number of elements to initially create.
<span class="lineNum">     227 </span>                :        *  @param  value  An element to copy.
<span class="lineNum">     228 </span>                :        *  @param  a  An allocator.
<span class="lineNum">     229 </span>                :        *
<span class="lineNum">     230 </span>                :        *  This constructor fills the %vector with @a n copies of @a value.
<span class="lineNum">     231 </span>                :        */
<span class="lineNum">     232 </span>                :       explicit
<span class="lineNum">     233 </span>                :       vector(size_type __n, const value_type&amp; __value = value_type(),
<span class="lineNum">     234 </span>                :              const allocator_type&amp; __a = allocator_type())
<span class="lineNum">     235 </span>                :       : _Base(__n, __a)
<span class="lineNum">     236 </span>                :       { _M_fill_initialize(__n, __value); }
<span class="lineNum">     237 </span>                : 
<span class="lineNum">     238 </span>                :       /**
<span class="lineNum">     239 </span>                :        *  @brief  %Vector copy constructor.
<span class="lineNum">     240 </span>                :        *  @param  x  A %vector of identical element and allocator types.
<span class="lineNum">     241 </span>                :        *
<span class="lineNum">     242 </span>                :        *  The newly-created %vector uses a copy of the allocation
<span class="lineNum">     243 </span>                :        *  object used by @a x.  All the elements of @a x are copied,
<span class="lineNum">     244 </span>                :        *  but any extra memory in
<span class="lineNum">     245 </span>                :        *  @a x (for fast expansion) will not be copied.
<span class="lineNum">     246 </span>                :        */
<span class="lineNum">     247 </span><span class="lineCov">           3328 :       vector(const vector&amp; __x)</span>
<span class="lineNum">     248 </span><span class="lineCov">           6656 :       : _Base(__x.size(), __x._M_get_Tp_allocator())</span>
<span class="lineNum">     249 </span><span class="lineCov">          12992 :       { this-&gt;_M_impl._M_finish =</span>
<span class="lineNum">     250 </span>                :           std::__uninitialized_copy_a(__x.begin(), __x.end(),
<span class="lineNum">     251 </span>                :                                       this-&gt;_M_impl._M_start,
<span class="lineNum">     252 </span>                :                                       _M_get_Tp_allocator());
<span class="lineNum">     253 </span><span class="lineCov">           3328 :       }</span>
<span class="lineNum">     254 </span>                : 
<span class="lineNum">     255 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     256 </span>                :       /**
<span class="lineNum">     257 </span>                :        *  @brief  %Vector move constructor.
<span class="lineNum">     258 </span>                :        *  @param  x  A %vector of identical element and allocator types.
<span class="lineNum">     259 </span>                :        *
<span class="lineNum">     260 </span>                :        *  The newly-created %vector contains the exact contents of @a x.
<span class="lineNum">     261 </span>                :        *  The contents of @a x are a valid, but unspecified %vector.
<span class="lineNum">     262 </span>                :        */
<span class="lineNum">     263 </span>                :       vector(vector&amp;&amp; __x)
<span class="lineNum">     264 </span>                :       : _Base(std::forward&lt;_Base&gt;(__x)) { }
<span class="lineNum">     265 </span>                : #endif
<span class="lineNum">     266 </span>                : 
<span class="lineNum">     267 </span>                :       /**
<span class="lineNum">     268 </span>                :        *  @brief  Builds a %vector from a range.
<span class="lineNum">     269 </span>                :        *  @param  first  An input iterator.
<span class="lineNum">     270 </span>                :        *  @param  last  An input iterator.
<span class="lineNum">     271 </span>                :        *  @param  a  An allocator.
<span class="lineNum">     272 </span>                :        *
<span class="lineNum">     273 </span>                :        *  Create a %vector consisting of copies of the elements from
<span class="lineNum">     274 </span>                :        *  [first,last).
<span class="lineNum">     275 </span>                :        *
<span class="lineNum">     276 </span>                :        *  If the iterators are forward, bidirectional, or
<span class="lineNum">     277 </span>                :        *  random-access, then this will call the elements' copy
<span class="lineNum">     278 </span>                :        *  constructor N times (where N is distance(first,last)) and do
<span class="lineNum">     279 </span>                :        *  no memory reallocation.  But if only input iterators are
<span class="lineNum">     280 </span>                :        *  used, then this will do at most 2N calls to the copy
<span class="lineNum">     281 </span>                :        *  constructor, and logN memory reallocations.
<span class="lineNum">     282 </span>                :        */
<span class="lineNum">     283 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">     284 </span>                :         vector(_InputIterator __first, _InputIterator __last,
<span class="lineNum">     285 </span>                :                const allocator_type&amp; __a = allocator_type())
<span class="lineNum">     286 </span>                :         : _Base(__a)
<span class="lineNum">     287 </span>                :         {
<span class="lineNum">     288 </span>                :           // Check whether it's an integral type.  If so, it's not an iterator.
<span class="lineNum">     289 </span>                :           typedef typename std::__is_integer&lt;_InputIterator&gt;::__type _Integral;
<span class="lineNum">     290 </span>                :           _M_initialize_dispatch(__first, __last, _Integral());
<span class="lineNum">     291 </span>                :         }
<span class="lineNum">     292 </span>                : 
<span class="lineNum">     293 </span>                :       /**
<span class="lineNum">     294 </span>                :        *  The dtor only erases the elements, and note that if the
<span class="lineNum">     295 </span>                :        *  elements themselves are pointers, the pointed-to memory is
<span class="lineNum">     296 </span>                :        *  not touched in any way.  Managing the pointer is the user's
<span class="lineNum">     297 </span>                :        *  responsibility.
<span class="lineNum">     298 </span>                :        */
<span class="lineNum">     299 </span><span class="lineCov">           1273 :       ~vector()</span>
<span class="lineNum">     300 </span><span class="lineCov">       89337180 :       { std::_Destroy(this-&gt;_M_impl._M_start, this-&gt;_M_impl._M_finish,</span>
<span class="lineNum">     301 </span><span class="lineCov">           1273 :                       _M_get_Tp_allocator()); }</span>
<span class="lineNum">     302 </span>                : 
<span class="lineNum">     303 </span>                :       /**
<span class="lineNum">     304 </span>                :        *  @brief  %Vector assignment operator.
<span class="lineNum">     305 </span>                :        *  @param  x  A %vector of identical element and allocator types.
<span class="lineNum">     306 </span>                :        *
<span class="lineNum">     307 </span>                :        *  All the elements of @a x are copied, but any extra memory in
<span class="lineNum">     308 </span>                :        *  @a x (for fast expansion) will not be copied.  Unlike the
<span class="lineNum">     309 </span>                :        *  copy constructor, the allocator object is not copied.
<span class="lineNum">     310 </span>                :        */
<span class="lineNum">     311 </span>                :       vector&amp;
<span class="lineNum">     312 </span>                :       operator=(const vector&amp; __x);
<span class="lineNum">     313 </span>                : 
<span class="lineNum">     314 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     315 </span>                :       /**
<span class="lineNum">     316 </span>                :        *  @brief  %Vector move assignment operator.
<span class="lineNum">     317 </span>                :        *  @param  x  A %vector of identical element and allocator types.
<span class="lineNum">     318 </span>                :        *
<span class="lineNum">     319 </span>                :        *  The contents of @a x are moved into this %vector (without copying).
<span class="lineNum">     320 </span>                :        *  @a x is a valid, but unspecified %vector.
<span class="lineNum">     321 </span>                :        */
<span class="lineNum">     322 </span>                :       vector&amp;
<span class="lineNum">     323 </span>                :       operator=(vector&amp;&amp; __x)
<span class="lineNum">     324 </span>                :       {
<span class="lineNum">     325 </span>                :         // NB: DR 675.
<span class="lineNum">     326 </span>                :         this-&gt;clear();
<span class="lineNum">     327 </span>                :         this-&gt;swap(__x); 
<span class="lineNum">     328 </span>                :         return *this;
<span class="lineNum">     329 </span>                :       }
<span class="lineNum">     330 </span>                : #endif
<span class="lineNum">     331 </span>                : 
<span class="lineNum">     332 </span>                :       /**
<span class="lineNum">     333 </span>                :        *  @brief  Assigns a given value to a %vector.
<span class="lineNum">     334 </span>                :        *  @param  n  Number of elements to be assigned.
<span class="lineNum">     335 </span>                :        *  @param  val  Value to be assigned.
<span class="lineNum">     336 </span>                :        *
<span class="lineNum">     337 </span>                :        *  This function fills a %vector with @a n copies of the given
<span class="lineNum">     338 </span>                :        *  value.  Note that the assignment completely changes the
<span class="lineNum">     339 </span>                :        *  %vector and that the resulting %vector's size is the same as
<span class="lineNum">     340 </span>                :        *  the number of elements assigned.  Old data may be lost.
<span class="lineNum">     341 </span>                :        */
<span class="lineNum">     342 </span>                :       void
<span class="lineNum">     343 </span>                :       assign(size_type __n, const value_type&amp; __val)
<span class="lineNum">     344 </span>                :       { _M_fill_assign(__n, __val); }
<span class="lineNum">     345 </span>                : 
<span class="lineNum">     346 </span>                :       /**
<span class="lineNum">     347 </span>                :        *  @brief  Assigns a range to a %vector.
<span class="lineNum">     348 </span>                :        *  @param  first  An input iterator.
<span class="lineNum">     349 </span>                :        *  @param  last   An input iterator.
<span class="lineNum">     350 </span>                :        *
<span class="lineNum">     351 </span>                :        *  This function fills a %vector with copies of the elements in the
<span class="lineNum">     352 </span>                :        *  range [first,last).
<span class="lineNum">     353 </span>                :        *
<span class="lineNum">     354 </span>                :        *  Note that the assignment completely changes the %vector and
<span class="lineNum">     355 </span>                :        *  that the resulting %vector's size is the same as the number
<span class="lineNum">     356 </span>                :        *  of elements assigned.  Old data may be lost.
<span class="lineNum">     357 </span>                :        */
<span class="lineNum">     358 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">     359 </span>                :         void
<span class="lineNum">     360 </span>                :         assign(_InputIterator __first, _InputIterator __last)
<span class="lineNum">     361 </span>                :         {
<span class="lineNum">     362 </span>                :           // Check whether it's an integral type.  If so, it's not an iterator.
<span class="lineNum">     363 </span>                :           typedef typename std::__is_integer&lt;_InputIterator&gt;::__type _Integral;
<span class="lineNum">     364 </span>                :           _M_assign_dispatch(__first, __last, _Integral());
<span class="lineNum">     365 </span>                :         }
<span class="lineNum">     366 </span>                : 
<span class="lineNum">     367 </span>                :       /// Get a copy of the memory allocation object.
<span class="lineNum">     368 </span>                :       using _Base::get_allocator;
<span class="lineNum">     369 </span>                : 
<span class="lineNum">     370 </span>                :       // iterators
<span class="lineNum">     371 </span>                :       /**
<span class="lineNum">     372 </span>                :        *  Returns a read/write iterator that points to the first
<span class="lineNum">     373 </span>                :        *  element in the %vector.  Iteration is done in ordinary
<span class="lineNum">     374 </span>                :        *  element order.
<span class="lineNum">     375 </span>                :        */
<span class="lineNum">     376 </span>                :       iterator
<span class="lineNum">     377 </span><span class="lineNoCov">              0 :       begin()</span>
<span class="lineNum">     378 </span><span class="lineCov">        7336472 :       { return iterator(this-&gt;_M_impl._M_start); }</span>
<span class="lineNum">     379 </span>                : 
<span class="lineNum">     380 </span>                :       /**
<span class="lineNum">     381 </span>                :        *  Returns a read-only (constant) iterator that points to the
<span class="lineNum">     382 </span>                :        *  first element in the %vector.  Iteration is done in ordinary
<span class="lineNum">     383 </span>                :        *  element order.
<span class="lineNum">     384 </span>                :        */
<span class="lineNum">     385 </span>                :       const_iterator
<span class="lineNum">     386 </span><span class="lineNoCov">              0 :       begin() const</span>
<span class="lineNum">     387 </span><span class="lineCov">       13023163 :       { return const_iterator(this-&gt;_M_impl._M_start); }</span>
<span class="lineNum">     388 </span>                : 
<span class="lineNum">     389 </span>                :       /**
<span class="lineNum">     390 </span>                :        *  Returns a read/write iterator that points one past the last
<span class="lineNum">     391 </span>                :        *  element in the %vector.  Iteration is done in ordinary
<span class="lineNum">     392 </span>                :        *  element order.
<span class="lineNum">     393 </span>                :        */
<span class="lineNum">     394 </span>                :       iterator
<span class="lineNum">     395 </span><span class="lineNoCov">              0 :       end()</span>
<span class="lineNum">     396 </span><span class="lineCov">       20689041 :       { return iterator(this-&gt;_M_impl._M_finish); }</span>
<span class="lineNum">     397 </span>                : 
<span class="lineNum">     398 </span>                :       /**
<span class="lineNum">     399 </span>                :        *  Returns a read-only (constant) iterator that points one past
<span class="lineNum">     400 </span>                :        *  the last element in the %vector.  Iteration is done in
<span class="lineNum">     401 </span>                :        *  ordinary element order.
<span class="lineNum">     402 </span>                :        */
<span class="lineNum">     403 </span>                :       const_iterator
<span class="lineNum">     404 </span><span class="lineNoCov">              0 :       end() const</span>
<span class="lineNum">     405 </span><span class="lineCov">       13023163 :       { return const_iterator(this-&gt;_M_impl._M_finish); }</span>
<span class="lineNum">     406 </span>                : 
<span class="lineNum">     407 </span>                :       /**
<span class="lineNum">     408 </span>                :        *  Returns a read/write reverse iterator that points to the
<span class="lineNum">     409 </span>                :        *  last element in the %vector.  Iteration is done in reverse
<span class="lineNum">     410 </span>                :        *  element order.
<span class="lineNum">     411 </span>                :        */
<span class="lineNum">     412 </span>                :       reverse_iterator
<span class="lineNum">     413 </span>                :       rbegin()
<span class="lineNum">     414 </span>                :       { return reverse_iterator(end()); }
<span class="lineNum">     415 </span>                : 
<span class="lineNum">     416 </span>                :       /**
<span class="lineNum">     417 </span>                :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">     418 </span>                :        *  to the last element in the %vector.  Iteration is done in
<span class="lineNum">     419 </span>                :        *  reverse element order.
<span class="lineNum">     420 </span>                :        */
<span class="lineNum">     421 </span>                :       const_reverse_iterator
<span class="lineNum">     422 </span>                :       rbegin() const
<span class="lineNum">     423 </span>                :       { return const_reverse_iterator(end()); }
<span class="lineNum">     424 </span>                : 
<span class="lineNum">     425 </span>                :       /**
<span class="lineNum">     426 </span>                :        *  Returns a read/write reverse iterator that points to one
<span class="lineNum">     427 </span>                :        *  before the first element in the %vector.  Iteration is done
<span class="lineNum">     428 </span>                :        *  in reverse element order.
<span class="lineNum">     429 </span>                :        */
<span class="lineNum">     430 </span>                :       reverse_iterator
<span class="lineNum">     431 </span>                :       rend()
<span class="lineNum">     432 </span>                :       { return reverse_iterator(begin()); }
<span class="lineNum">     433 </span>                : 
<span class="lineNum">     434 </span>                :       /**
<span class="lineNum">     435 </span>                :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">     436 </span>                :        *  to one before the first element in the %vector.  Iteration
<span class="lineNum">     437 </span>                :        *  is done in reverse element order.
<span class="lineNum">     438 </span>                :        */
<span class="lineNum">     439 </span>                :       const_reverse_iterator
<span class="lineNum">     440 </span>                :       rend() const
<span class="lineNum">     441 </span>                :       { return const_reverse_iterator(begin()); }
<span class="lineNum">     442 </span>                : 
<span class="lineNum">     443 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     444 </span>                :       /**
<span class="lineNum">     445 </span>                :        *  Returns a read-only (constant) iterator that points to the
<span class="lineNum">     446 </span>                :        *  first element in the %vector.  Iteration is done in ordinary
<span class="lineNum">     447 </span>                :        *  element order.
<span class="lineNum">     448 </span>                :        */
<span class="lineNum">     449 </span>                :       const_iterator
<span class="lineNum">     450 </span>                :       cbegin() const
<span class="lineNum">     451 </span>                :       { return const_iterator(this-&gt;_M_impl._M_start); }
<span class="lineNum">     452 </span>                : 
<span class="lineNum">     453 </span>                :       /**
<span class="lineNum">     454 </span>                :        *  Returns a read-only (constant) iterator that points one past
<span class="lineNum">     455 </span>                :        *  the last element in the %vector.  Iteration is done in
<span class="lineNum">     456 </span>                :        *  ordinary element order.
<span class="lineNum">     457 </span>                :        */
<span class="lineNum">     458 </span>                :       const_iterator
<span class="lineNum">     459 </span>                :       cend() const
<span class="lineNum">     460 </span>                :       { return const_iterator(this-&gt;_M_impl._M_finish); }
<span class="lineNum">     461 </span>                : 
<span class="lineNum">     462 </span>                :       /**
<span class="lineNum">     463 </span>                :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">     464 </span>                :        *  to the last element in the %vector.  Iteration is done in
<span class="lineNum">     465 </span>                :        *  reverse element order.
<span class="lineNum">     466 </span>                :        */
<span class="lineNum">     467 </span>                :       const_reverse_iterator
<span class="lineNum">     468 </span>                :       crbegin() const
<span class="lineNum">     469 </span>                :       { return const_reverse_iterator(end()); }
<span class="lineNum">     470 </span>                : 
<span class="lineNum">     471 </span>                :       /**
<span class="lineNum">     472 </span>                :        *  Returns a read-only (constant) reverse iterator that points
<span class="lineNum">     473 </span>                :        *  to one before the first element in the %vector.  Iteration
<span class="lineNum">     474 </span>                :        *  is done in reverse element order.
<span class="lineNum">     475 </span>                :        */
<span class="lineNum">     476 </span>                :       const_reverse_iterator
<span class="lineNum">     477 </span>                :       crend() const
<span class="lineNum">     478 </span>                :       { return const_reverse_iterator(begin()); }
<span class="lineNum">     479 </span>                : #endif
<span class="lineNum">     480 </span>                : 
<span class="lineNum">     481 </span>                :       // [23.2.4.2] capacity
<span class="lineNum">     482 </span>                :       /**  Returns the number of elements in the %vector.  */
<span class="lineNum">     483 </span>                :       size_type
<span class="lineNum">     484 </span><span class="lineNoCov">              0 :       size() const</span>
<span class="lineNum">     485 </span><span class="lineCov">      140283991 :       { return size_type(this-&gt;_M_impl._M_finish - this-&gt;_M_impl._M_start); }</span>
<span class="lineNum">     486 </span>                : 
<span class="lineNum">     487 </span>                :       /**  Returns the size() of the largest possible %vector.  */
<span class="lineNum">     488 </span>                :       size_type
<span class="lineNum">     489 </span><span class="lineNoCov">              0 :       max_size() const</span>
<span class="lineNum">     490 </span><span class="lineCov">       70215588 :       { return _M_get_Tp_allocator().max_size(); }</span>
<span class="lineNum">     491 </span>                : 
<span class="lineNum">     492 </span>                :       /**
<span class="lineNum">     493 </span>                :        *  @brief  Resizes the %vector to the specified number of elements.
<span class="lineNum">     494 </span>                :        *  @param  new_size  Number of elements the %vector should contain.
<span class="lineNum">     495 </span>                :        *  @param  x  Data with which new elements should be populated.
<span class="lineNum">     496 </span>                :        *
<span class="lineNum">     497 </span>                :        *  This function will %resize the %vector to the specified
<span class="lineNum">     498 </span>                :        *  number of elements.  If the number is smaller than the
<span class="lineNum">     499 </span>                :        *  %vector's current size the %vector is truncated, otherwise
<span class="lineNum">     500 </span>                :        *  the %vector is extended and new elements are populated with
<span class="lineNum">     501 </span>                :        *  given data.
<span class="lineNum">     502 </span>                :        */
<span class="lineNum">     503 </span>                :       void
<span class="lineNum">     504 </span><span class="lineCov">        3744942 :       resize(size_type __new_size, value_type __x = value_type())</span>
<span class="lineNum">     505 </span>                :       {
<span class="lineNum">     506 </span><span class="lineCov">        3744942 :         if (__new_size &lt; size())</span>
<span class="lineNum">     507 </span><span class="lineNoCov">              0 :           _M_erase_at_end(this-&gt;_M_impl._M_start + __new_size);</span>
<span class="lineNum">     508 </span>                :         else
<span class="lineNum">     509 </span><span class="lineCov">        7489884 :           insert(end(), __new_size - size(), __x);</span>
<span class="lineNum">     510 </span><span class="lineCov">        3744942 :       }</span>
<span class="lineNum">     511 </span>                : 
<span class="lineNum">     512 </span>                :       /**
<span class="lineNum">     513 </span>                :        *  Returns the total number of elements that the %vector can
<span class="lineNum">     514 </span>                :        *  hold before needing to allocate more memory.
<span class="lineNum">     515 </span>                :        */
<span class="lineNum">     516 </span>                :       size_type
<span class="lineNum">     517 </span><span class="lineNoCov">              0 :       capacity() const</span>
<span class="lineNum">     518 </span>                :       { return size_type(this-&gt;_M_impl._M_end_of_storage
<span class="lineNum">     519 </span><span class="lineNoCov">              0 :                          - this-&gt;_M_impl._M_start); }</span>
<span class="lineNum">     520 </span>                : 
<span class="lineNum">     521 </span>                :       /**
<span class="lineNum">     522 </span>                :        *  Returns true if the %vector is empty.  (Thus begin() would
<span class="lineNum">     523 </span>                :        *  equal end().)
<span class="lineNum">     524 </span>                :        */
<span class="lineNum">     525 </span>                :       bool
<span class="lineNum">     526 </span><span class="lineNoCov">              0 :       empty() const</span>
<span class="lineNum">     527 </span><span class="lineCov">       13019835 :       { return begin() == end(); }</span>
<span class="lineNum">     528 </span>                : 
<span class="lineNum">     529 </span>                :       /**
<span class="lineNum">     530 </span>                :        *  @brief  Attempt to preallocate enough memory for specified number of
<span class="lineNum">     531 </span>                :        *          elements.
<span class="lineNum">     532 </span>                :        *  @param  n  Number of elements required.
<span class="lineNum">     533 </span>                :        *  @throw  std::length_error  If @a n exceeds @c max_size().
<span class="lineNum">     534 </span>                :        *
<span class="lineNum">     535 </span>                :        *  This function attempts to reserve enough memory for the
<span class="lineNum">     536 </span>                :        *  %vector to hold the specified number of elements.  If the
<span class="lineNum">     537 </span>                :        *  number requested is more than max_size(), length_error is
<span class="lineNum">     538 </span>                :        *  thrown.
<span class="lineNum">     539 </span>                :        *
<span class="lineNum">     540 </span>                :        *  The advantage of this function is that if optimal code is a
<span class="lineNum">     541 </span>                :        *  necessity and the user can determine the number of elements
<span class="lineNum">     542 </span>                :        *  that will be required, the user can reserve the memory in
<span class="lineNum">     543 </span>                :        *  %advance, and thus prevent a possible reallocation of memory
<span class="lineNum">     544 </span>                :        *  and copying of %vector data.
<span class="lineNum">     545 </span>                :        */
<span class="lineNum">     546 </span>                :       void
<span class="lineNum">     547 </span>                :       reserve(size_type __n);
<span class="lineNum">     548 </span>                : 
<span class="lineNum">     549 </span>                :       // element access
<span class="lineNum">     550 </span>                :       /**
<span class="lineNum">     551 </span>                :        *  @brief  Subscript access to the data contained in the %vector.
<span class="lineNum">     552 </span>                :        *  @param n The index of the element for which data should be
<span class="lineNum">     553 </span>                :        *  accessed.
<span class="lineNum">     554 </span>                :        *  @return  Read/write reference to data.
<span class="lineNum">     555 </span>                :        *
<span class="lineNum">     556 </span>                :        *  This operator allows for easy, array-style, data access.
<span class="lineNum">     557 </span>                :        *  Note that data access with this operator is unchecked and
<span class="lineNum">     558 </span>                :        *  out_of_range lookups are not defined. (For checked lookups
<span class="lineNum">     559 </span>                :        *  see at().)
<span class="lineNum">     560 </span>                :        */
<span class="lineNum">     561 </span>                :       reference
<span class="lineNum">     562 </span><span class="lineNoCov">              0 :       operator[](size_type __n)</span>
<span class="lineNum">     563 </span><span class="lineCov">     1497970438 :       { return *(this-&gt;_M_impl._M_start + __n); }</span>
<span class="lineNum">     564 </span>                : 
<span class="lineNum">     565 </span>                :       /**
<span class="lineNum">     566 </span>                :        *  @brief  Subscript access to the data contained in the %vector.
<span class="lineNum">     567 </span>                :        *  @param n The index of the element for which data should be
<span class="lineNum">     568 </span>                :        *  accessed.
<span class="lineNum">     569 </span>                :        *  @return  Read-only (constant) reference to data.
<span class="lineNum">     570 </span>                :        *
<span class="lineNum">     571 </span>                :        *  This operator allows for easy, array-style, data access.
<span class="lineNum">     572 </span>                :        *  Note that data access with this operator is unchecked and
<span class="lineNum">     573 </span>                :        *  out_of_range lookups are not defined. (For checked lookups
<span class="lineNum">     574 </span>                :        *  see at().)
<span class="lineNum">     575 </span>                :        */
<span class="lineNum">     576 </span>                :       const_reference
<span class="lineNum">     577 </span><span class="lineNoCov">              0 :       operator[](size_type __n) const</span>
<span class="lineNum">     578 </span><span class="lineCov">       33195850 :       { return *(this-&gt;_M_impl._M_start + __n); }</span>
<span class="lineNum">     579 </span>                : 
<span class="lineNum">     580 </span>                :     protected:
<span class="lineNum">     581 </span>                :       /// Safety check used only from at().
<span class="lineNum">     582 </span>                :       void
<span class="lineNum">     583 </span><span class="lineCov">       12464715 :       _M_range_check(size_type __n) const</span>
<span class="lineNum">     584 </span>                :       {
<span class="lineNum">     585 </span><span class="lineCov">       12464715 :         if (__n &gt;= this-&gt;size())</span>
<span class="lineNum">     586 </span><span class="lineNoCov">              0 :           __throw_out_of_range(__N(&quot;vector::_M_range_check&quot;));</span>
<span class="lineNum">     587 </span><span class="lineCov">       12464715 :       }</span>
<span class="lineNum">     588 </span>                : 
<span class="lineNum">     589 </span>                :     public:
<span class="lineNum">     590 </span>                :       /**
<span class="lineNum">     591 </span>                :        *  @brief  Provides access to the data contained in the %vector.
<span class="lineNum">     592 </span>                :        *  @param n The index of the element for which data should be
<span class="lineNum">     593 </span>                :        *  accessed.
<span class="lineNum">     594 </span>                :        *  @return  Read/write reference to data.
<span class="lineNum">     595 </span>                :        *  @throw  std::out_of_range  If @a n is an invalid index.
<span class="lineNum">     596 </span>                :        *
<span class="lineNum">     597 </span>                :        *  This function provides for safer data access.  The parameter
<span class="lineNum">     598 </span>                :        *  is first checked that it is in the range of the vector.  The
<span class="lineNum">     599 </span>                :        *  function throws out_of_range if the check fails.
<span class="lineNum">     600 </span>                :        */
<span class="lineNum">     601 </span>                :       reference
<span class="lineNum">     602 </span><span class="lineCov">       12464715 :       at(size_type __n)</span>
<span class="lineNum">     603 </span>                :       {
<span class="lineNum">     604 </span><span class="lineCov">       12464715 :         _M_range_check(__n);</span>
<span class="lineNum">     605 </span><span class="lineCov">       12464715 :         return (*this)[__n]; </span>
<span class="lineNum">     606 </span>                :       }
<span class="lineNum">     607 </span>                : 
<span class="lineNum">     608 </span>                :       /**
<span class="lineNum">     609 </span>                :        *  @brief  Provides access to the data contained in the %vector.
<span class="lineNum">     610 </span>                :        *  @param n The index of the element for which data should be
<span class="lineNum">     611 </span>                :        *  accessed.
<span class="lineNum">     612 </span>                :        *  @return  Read-only (constant) reference to data.
<span class="lineNum">     613 </span>                :        *  @throw  std::out_of_range  If @a n is an invalid index.
<span class="lineNum">     614 </span>                :        *
<span class="lineNum">     615 </span>                :        *  This function provides for safer data access.  The parameter
<span class="lineNum">     616 </span>                :        *  is first checked that it is in the range of the vector.  The
<span class="lineNum">     617 </span>                :        *  function throws out_of_range if the check fails.
<span class="lineNum">     618 </span>                :        */
<span class="lineNum">     619 </span>                :       const_reference
<span class="lineNum">     620 </span>                :       at(size_type __n) const
<span class="lineNum">     621 </span>                :       {
<span class="lineNum">     622 </span>                :         _M_range_check(__n);
<span class="lineNum">     623 </span>                :         return (*this)[__n];
<span class="lineNum">     624 </span>                :       }
<span class="lineNum">     625 </span>                : 
<span class="lineNum">     626 </span>                :       /**
<span class="lineNum">     627 </span>                :        *  Returns a read/write reference to the data at the first
<span class="lineNum">     628 </span>                :        *  element of the %vector.
<span class="lineNum">     629 </span>                :        */
<span class="lineNum">     630 </span>                :       reference
<span class="lineNum">     631 </span><span class="lineNoCov">              0 :       front()</span>
<span class="lineNum">     632 </span><span class="lineNoCov">              0 :       { return *begin(); }</span>
<span class="lineNum">     633 </span>                : 
<span class="lineNum">     634 </span>                :       /**
<span class="lineNum">     635 </span>                :        *  Returns a read-only (constant) reference to the data at the first
<span class="lineNum">     636 </span>                :        *  element of the %vector.
<span class="lineNum">     637 </span>                :        */
<span class="lineNum">     638 </span>                :       const_reference
<span class="lineNum">     639 </span>                :       front() const
<span class="lineNum">     640 </span>                :       { return *begin(); }
<span class="lineNum">     641 </span>                : 
<span class="lineNum">     642 </span>                :       /**
<span class="lineNum">     643 </span>                :        *  Returns a read/write reference to the data at the last
<span class="lineNum">     644 </span>                :        *  element of the %vector.
<span class="lineNum">     645 </span>                :        */
<span class="lineNum">     646 </span>                :       reference
<span class="lineNum">     647 </span><span class="lineNoCov">              0 :       back()</span>
<span class="lineNum">     648 </span><span class="lineNoCov">              0 :       { return *(end() - 1); }</span>
<span class="lineNum">     649 </span>                :       
<span class="lineNum">     650 </span>                :       /**
<span class="lineNum">     651 </span>                :        *  Returns a read-only (constant) reference to the data at the
<span class="lineNum">     652 </span>                :        *  last element of the %vector.
<span class="lineNum">     653 </span>                :        */
<span class="lineNum">     654 </span>                :       const_reference
<span class="lineNum">     655 </span>                :       back() const
<span class="lineNum">     656 </span>                :       { return *(end() - 1); }
<span class="lineNum">     657 </span>                : 
<span class="lineNum">     658 </span>                :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     659 </span>                :       // DR 464. Suggestion for new member functions in standard containers.
<span class="lineNum">     660 </span>                :       // data access
<span class="lineNum">     661 </span>                :       /**
<span class="lineNum">     662 </span>                :        *   Returns a pointer such that [data(), data() + size()) is a valid
<span class="lineNum">     663 </span>                :        *   range.  For a non-empty %vector, data() == &amp;front().
<span class="lineNum">     664 </span>                :        */
<span class="lineNum">     665 </span>                :       pointer
<span class="lineNum">     666 </span>                :       data()
<span class="lineNum">     667 </span>                :       { return pointer(this-&gt;_M_impl._M_start); }
<span class="lineNum">     668 </span>                : 
<span class="lineNum">     669 </span>                :       const_pointer
<span class="lineNum">     670 </span>                :       data() const
<span class="lineNum">     671 </span>                :       { return const_pointer(this-&gt;_M_impl._M_start); }
<span class="lineNum">     672 </span>                : 
<span class="lineNum">     673 </span>                :       // [23.2.4.3] modifiers
<span class="lineNum">     674 </span>                :       /**
<span class="lineNum">     675 </span>                :        *  @brief  Add data to the end of the %vector.
<span class="lineNum">     676 </span>                :        *  @param  x  Data to be added.
<span class="lineNum">     677 </span>                :        *
<span class="lineNum">     678 </span>                :        *  This is a typical stack operation.  The function creates an
<span class="lineNum">     679 </span>                :        *  element at the end of the %vector and assigns the given data
<span class="lineNum">     680 </span>                :        *  to it.  Due to the nature of a %vector this operation can be
<span class="lineNum">     681 </span>                :        *  done in constant time if the %vector has preallocated space
<span class="lineNum">     682 </span>                :        *  available.
<span class="lineNum">     683 </span>                :        */
<span class="lineNum">     684 </span>                : #ifndef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     685 </span>                :       void
<span class="lineNum">     686 </span><span class="lineCov">       12634548 :       push_back(const value_type&amp; __x)</span>
<span class="lineNum">     687 </span>                :       {
<span class="lineNum">     688 </span><span class="lineCov">       12634548 :         if (this-&gt;_M_impl._M_finish != this-&gt;_M_impl._M_end_of_storage)</span>
<span class="lineNum">     689 </span>                :           {
<span class="lineNum">     690 </span><span class="lineCov">         935728 :             this-&gt;_M_impl.construct(this-&gt;_M_impl._M_finish, __x);</span>
<span class="lineNum">     691 </span><span class="lineCov">         935728 :             ++this-&gt;_M_impl._M_finish;</span>
<span class="lineNum">     692 </span>                :           }
<span class="lineNum">     693 </span>                :         else
<span class="lineNum">     694 </span><span class="lineCov">       11698820 :           _M_insert_aux(end(), __x);</span>
<span class="lineNum">     695 </span><span class="lineCov">       12634548 :       }</span>
<span class="lineNum">     696 </span>                : #else
<span class="lineNum">     697 </span>                :       template&lt;typename... _Args&gt;
<span class="lineNum">     698 </span>                :         void
<span class="lineNum">     699 </span>                :         push_back(_Args&amp;&amp;... __args)
<span class="lineNum">     700 </span>                :         {
<span class="lineNum">     701 </span>                :           if (this-&gt;_M_impl._M_finish != this-&gt;_M_impl._M_end_of_storage)
<span class="lineNum">     702 </span>                :             {
<span class="lineNum">     703 </span>                :               this-&gt;_M_impl.construct(this-&gt;_M_impl._M_finish,
<span class="lineNum">     704 </span>                :                                       std::forward&lt;_Args&gt;(__args)...);
<span class="lineNum">     705 </span>                :               ++this-&gt;_M_impl._M_finish;
<span class="lineNum">     706 </span>                :             }
<span class="lineNum">     707 </span>                :           else
<span class="lineNum">     708 </span>                :             _M_insert_aux(end(), std::forward&lt;_Args&gt;(__args)...);
<span class="lineNum">     709 </span>                :         }
<span class="lineNum">     710 </span>                : #endif
<span class="lineNum">     711 </span>                : 
<span class="lineNum">     712 </span>                :       /**
<span class="lineNum">     713 </span>                :        *  @brief  Removes last element.
<span class="lineNum">     714 </span>                :        *
<span class="lineNum">     715 </span>                :        *  This is a typical stack operation. It shrinks the %vector by one.
<span class="lineNum">     716 </span>                :        *
<span class="lineNum">     717 </span>                :        *  Note that no data is returned, and if the last element's
<span class="lineNum">     718 </span>                :        *  data is needed, it should be retrieved before pop_back() is
<span class="lineNum">     719 </span>                :        *  called.
<span class="lineNum">     720 </span>                :        */
<span class="lineNum">     721 </span>                :       void
<span class="lineNum">     722 </span>                :       pop_back()
<span class="lineNum">     723 </span>                :       {
<span class="lineNum">     724 </span>                :         --this-&gt;_M_impl._M_finish;
<span class="lineNum">     725 </span>                :         this-&gt;_M_impl.destroy(this-&gt;_M_impl._M_finish);
<span class="lineNum">     726 </span>                :       }
<span class="lineNum">     727 </span>                : 
<span class="lineNum">     728 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     729 </span>                :       /**
<span class="lineNum">     730 </span>                :        *  @brief  Inserts an object in %vector before specified iterator.
<span class="lineNum">     731 </span>                :        *  @param  position  An iterator into the %vector.
<span class="lineNum">     732 </span>                :        *  @param  args  Arguments.
<span class="lineNum">     733 </span>                :        *  @return  An iterator that points to the inserted data.
<span class="lineNum">     734 </span>                :        *
<span class="lineNum">     735 </span>                :        *  This function will insert an object of type T constructed
<span class="lineNum">     736 </span>                :        *  with T(std::forward&lt;Args&gt;(args)...) before the specified location.
<span class="lineNum">     737 </span>                :        *  Note that this kind of operation could be expensive for a %vector
<span class="lineNum">     738 </span>                :        *  and if it is frequently used the user should consider using
<span class="lineNum">     739 </span>                :        *  std::list.
<span class="lineNum">     740 </span>                :        */
<span class="lineNum">     741 </span>                :       template&lt;typename... _Args&gt;
<span class="lineNum">     742 </span>                :         iterator
<span class="lineNum">     743 </span>                :         emplace(iterator __position, _Args&amp;&amp;... __args);
<span class="lineNum">     744 </span>                : #endif
<span class="lineNum">     745 </span>                : 
<span class="lineNum">     746 </span>                :       /**
<span class="lineNum">     747 </span>                :        *  @brief  Inserts given value into %vector before specified iterator.
<span class="lineNum">     748 </span>                :        *  @param  position  An iterator into the %vector.
<span class="lineNum">     749 </span>                :        *  @param  x  Data to be inserted.
<span class="lineNum">     750 </span>                :        *  @return  An iterator that points to the inserted data.
<span class="lineNum">     751 </span>                :        *
<span class="lineNum">     752 </span>                :        *  This function will insert a copy of the given value before
<span class="lineNum">     753 </span>                :        *  the specified location.  Note that this kind of operation
<span class="lineNum">     754 </span>                :        *  could be expensive for a %vector and if it is frequently
<span class="lineNum">     755 </span>                :        *  used the user should consider using std::list.
<span class="lineNum">     756 </span>                :        */
<span class="lineNum">     757 </span>                :       iterator
<span class="lineNum">     758 </span>                :       insert(iterator __position, const value_type&amp; __x);
<span class="lineNum">     759 </span>                : 
<span class="lineNum">     760 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     761 </span>                :       /**
<span class="lineNum">     762 </span>                :        *  @brief  Inserts given rvalue into %vector before specified iterator.
<span class="lineNum">     763 </span>                :        *  @param  position  An iterator into the %vector.
<span class="lineNum">     764 </span>                :        *  @param  x  Data to be inserted.
<span class="lineNum">     765 </span>                :        *  @return  An iterator that points to the inserted data.
<span class="lineNum">     766 </span>                :        *
<span class="lineNum">     767 </span>                :        *  This function will insert a copy of the given rvalue before
<span class="lineNum">     768 </span>                :        *  the specified location.  Note that this kind of operation
<span class="lineNum">     769 </span>                :        *  could be expensive for a %vector and if it is frequently
<span class="lineNum">     770 </span>                :        *  used the user should consider using std::list.
<span class="lineNum">     771 </span>                :        */
<span class="lineNum">     772 </span>                :       iterator
<span class="lineNum">     773 </span>                :       insert(iterator __position, value_type&amp;&amp; __x)
<span class="lineNum">     774 </span>                :       { return emplace(__position, std::move(__x)); }
<span class="lineNum">     775 </span>                : #endif
<span class="lineNum">     776 </span>                : 
<span class="lineNum">     777 </span>                :       /**
<span class="lineNum">     778 </span>                :        *  @brief  Inserts a number of copies of given data into the %vector.
<span class="lineNum">     779 </span>                :        *  @param  position  An iterator into the %vector.
<span class="lineNum">     780 </span>                :        *  @param  n  Number of elements to be inserted.
<span class="lineNum">     781 </span>                :        *  @param  x  Data to be inserted.
<span class="lineNum">     782 </span>                :        *
<span class="lineNum">     783 </span>                :        *  This function will insert a specified number of copies of
<span class="lineNum">     784 </span>                :        *  the given data before the location specified by @a position.
<span class="lineNum">     785 </span>                :        *
<span class="lineNum">     786 </span>                :        *  Note that this kind of operation could be expensive for a
<span class="lineNum">     787 </span>                :        *  %vector and if it is frequently used the user should
<span class="lineNum">     788 </span>                :        *  consider using std::list.
<span class="lineNum">     789 </span>                :        */
<span class="lineNum">     790 </span>                :       void
<span class="lineNum">     791 </span><span class="lineNoCov">              0 :       insert(iterator __position, size_type __n, const value_type&amp; __x)</span>
<span class="lineNum">     792 </span><span class="lineCov">        3744942 :       { _M_fill_insert(__position, __n, __x); }</span>
<span class="lineNum">     793 </span>                : 
<span class="lineNum">     794 </span>                :       /**
<span class="lineNum">     795 </span>                :        *  @brief  Inserts a range into the %vector.
<span class="lineNum">     796 </span>                :        *  @param  position  An iterator into the %vector.
<span class="lineNum">     797 </span>                :        *  @param  first  An input iterator.
<span class="lineNum">     798 </span>                :        *  @param  last   An input iterator.
<span class="lineNum">     799 </span>                :        *
<span class="lineNum">     800 </span>                :        *  This function will insert copies of the data in the range
<span class="lineNum">     801 </span>                :        *  [first,last) into the %vector before the location specified
<span class="lineNum">     802 </span>                :        *  by @a pos.
<span class="lineNum">     803 </span>                :        *
<span class="lineNum">     804 </span>                :        *  Note that this kind of operation could be expensive for a
<span class="lineNum">     805 </span>                :        *  %vector and if it is frequently used the user should
<span class="lineNum">     806 </span>                :        *  consider using std::list.
<span class="lineNum">     807 </span>                :        */
<span class="lineNum">     808 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">     809 </span>                :         void
<span class="lineNum">     810 </span>                :         insert(iterator __position, _InputIterator __first,
<span class="lineNum">     811 </span>                :                _InputIterator __last)
<span class="lineNum">     812 </span>                :         {
<span class="lineNum">     813 </span>                :           // Check whether it's an integral type.  If so, it's not an iterator.
<span class="lineNum">     814 </span>                :           typedef typename std::__is_integer&lt;_InputIterator&gt;::__type _Integral;
<span class="lineNum">     815 </span>                :           _M_insert_dispatch(__position, __first, __last, _Integral());
<span class="lineNum">     816 </span>                :         }
<span class="lineNum">     817 </span>                : 
<span class="lineNum">     818 </span>                :       /**
<span class="lineNum">     819 </span>                :        *  @brief  Remove element at given position.
<span class="lineNum">     820 </span>                :        *  @param  position  Iterator pointing to element to be erased.
<span class="lineNum">     821 </span>                :        *  @return  An iterator pointing to the next element (or end()).
<span class="lineNum">     822 </span>                :        *
<span class="lineNum">     823 </span>                :        *  This function will erase the element at the given position and thus
<span class="lineNum">     824 </span>                :        *  shorten the %vector by one.
<span class="lineNum">     825 </span>                :        *
<span class="lineNum">     826 </span>                :        *  Note This operation could be expensive and if it is
<span class="lineNum">     827 </span>                :        *  frequently used the user should consider using std::list.
<span class="lineNum">     828 </span>                :        *  The user is also cautioned that this function only erases
<span class="lineNum">     829 </span>                :        *  the element, and that if the element is itself a pointer,
<span class="lineNum">     830 </span>                :        *  the pointed-to memory is not touched in any way.  Managing
<span class="lineNum">     831 </span>                :        *  the pointer is the user's responsibility.
<span class="lineNum">     832 </span>                :        */
<span class="lineNum">     833 </span>                :       iterator
<span class="lineNum">     834 </span>                :       erase(iterator __position);
<span class="lineNum">     835 </span>                : 
<span class="lineNum">     836 </span>                :       /**
<span class="lineNum">     837 </span>                :        *  @brief  Remove a range of elements.
<span class="lineNum">     838 </span>                :        *  @param  first  Iterator pointing to the first element to be erased.
<span class="lineNum">     839 </span>                :        *  @param  last  Iterator pointing to one past the last element to be
<span class="lineNum">     840 </span>                :        *                erased.
<span class="lineNum">     841 </span>                :        *  @return  An iterator pointing to the element pointed to by @a last
<span class="lineNum">     842 </span>                :        *           prior to erasing (or end()).
<span class="lineNum">     843 </span>                :        *
<span class="lineNum">     844 </span>                :        *  This function will erase the elements in the range [first,last) and
<span class="lineNum">     845 </span>                :        *  shorten the %vector accordingly.
<span class="lineNum">     846 </span>                :        *
<span class="lineNum">     847 </span>                :        *  Note This operation could be expensive and if it is
<span class="lineNum">     848 </span>                :        *  frequently used the user should consider using std::list.
<span class="lineNum">     849 </span>                :        *  The user is also cautioned that this function only erases
<span class="lineNum">     850 </span>                :        *  the elements, and that if the elements themselves are
<span class="lineNum">     851 </span>                :        *  pointers, the pointed-to memory is not touched in any way.
<span class="lineNum">     852 </span>                :        *  Managing the pointer is the user's responsibility.
<span class="lineNum">     853 </span>                :        */
<span class="lineNum">     854 </span>                :       iterator
<span class="lineNum">     855 </span>                :       erase(iterator __first, iterator __last);
<span class="lineNum">     856 </span>                : 
<span class="lineNum">     857 </span>                :       /**
<span class="lineNum">     858 </span>                :        *  @brief  Swaps data with another %vector.
<span class="lineNum">     859 </span>                :        *  @param  x  A %vector of the same element and allocator types.
<span class="lineNum">     860 </span>                :        *
<span class="lineNum">     861 </span>                :        *  This exchanges the elements between two vectors in constant time.
<span class="lineNum">     862 </span>                :        *  (Three pointers, so it should be quite fast.)
<span class="lineNum">     863 </span>                :        *  Note that the global std::swap() function is specialized such that
<span class="lineNum">     864 </span>                :        *  std::swap(v1,v2) will feed to this function.
<span class="lineNum">     865 </span>                :        */
<span class="lineNum">     866 </span>                :       void
<span class="lineNum">     867 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     868 </span>                :       swap(vector&amp;&amp; __x)
<span class="lineNum">     869 </span>                : #else
<span class="lineNum">     870 </span>                :       swap(vector&amp; __x)
<span class="lineNum">     871 </span>                : #endif
<span class="lineNum">     872 </span>                :       {
<span class="lineNum">     873 </span>                :         std::swap(this-&gt;_M_impl._M_start, __x._M_impl._M_start);
<span class="lineNum">     874 </span>                :         std::swap(this-&gt;_M_impl._M_finish, __x._M_impl._M_finish);
<span class="lineNum">     875 </span>                :         std::swap(this-&gt;_M_impl._M_end_of_storage,
<span class="lineNum">     876 </span>                :                   __x._M_impl._M_end_of_storage);
<span class="lineNum">     877 </span>                : 
<span class="lineNum">     878 </span>                :         // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     879 </span>                :         // 431. Swapping containers with unequal allocators.
<span class="lineNum">     880 </span>                :         std::__alloc_swap&lt;_Tp_alloc_type&gt;::_S_do_it(_M_get_Tp_allocator(),
<span class="lineNum">     881 </span>                :                                                     __x._M_get_Tp_allocator());
<span class="lineNum">     882 </span>                :       }
<span class="lineNum">     883 </span>                : 
<span class="lineNum">     884 </span>                :       /**
<span class="lineNum">     885 </span>                :        *  Erases all the elements.  Note that this function only erases the
<span class="lineNum">     886 </span>                :        *  elements, and that if the elements themselves are pointers, the
<span class="lineNum">     887 </span>                :        *  pointed-to memory is not touched in any way.  Managing the pointer is
<span class="lineNum">     888 </span>                :        *  the user's responsibility.
<span class="lineNum">     889 </span>                :        */
<span class="lineNum">     890 </span>                :       void
<span class="lineNum">     891 </span><span class="lineCov">            416 :       clear()</span>
<span class="lineNum">     892 </span><span class="lineCov">        3742156 :       { _M_erase_at_end(this-&gt;_M_impl._M_start); }</span>
<span class="lineNum">     893 </span>                : 
<span class="lineNum">     894 </span>                :     protected:
<span class="lineNum">     895 </span>                :       /**
<span class="lineNum">     896 </span>                :        *  Memory expansion handler.  Uses the member allocation function to
<span class="lineNum">     897 </span>                :        *  obtain @a n bytes of memory, and then copies [first,last) into it.
<span class="lineNum">     898 </span>                :        */
<span class="lineNum">     899 </span>                :       template&lt;typename _ForwardIterator&gt;
<span class="lineNum">     900 </span>                :         pointer
<span class="lineNum">     901 </span>                :         _M_allocate_and_copy(size_type __n,
<span class="lineNum">     902 </span><span class="lineNoCov">              0 :                              _ForwardIterator __first, _ForwardIterator __last)</span>
<span class="lineNum">     903 </span>                :         {
<span class="lineNum">     904 </span><span class="lineNoCov">              0 :           pointer __result = this-&gt;_M_allocate(__n);</span>
<span class="lineNum">     905 </span>                :           try
<span class="lineNum">     906 </span>                :             {
<span class="lineNum">     907 </span><span class="lineNoCov">              0 :               std::__uninitialized_copy_a(__first, __last, __result,</span>
<span class="lineNum">     908 </span>                :                                           _M_get_Tp_allocator());
<span class="lineNum">     909 </span><span class="lineNoCov">              0 :               return __result;</span>
<span class="lineNum">     910 </span>                :             }
<span class="lineNum">     911 </span><span class="lineNoCov">              0 :           catch(...)</span>
<span class="lineNum">     912 </span>                :             {
<span class="lineNum">     913 </span><span class="lineNoCov">              0 :               _M_deallocate(__result, __n);</span>
<span class="lineNum">     914 </span><span class="lineNoCov">              0 :               __throw_exception_again;</span>
<span class="lineNum">     915 </span>                :             }
<span class="lineNum">     916 </span>                :         }
<span class="lineNum">     917 </span>                : 
<span class="lineNum">     918 </span>                : 
<span class="lineNum">     919 </span>                :       // Internal constructor functions follow.
<span class="lineNum">     920 </span>                : 
<span class="lineNum">     921 </span>                :       // Called by the range constructor to implement [23.1.1]/9
<span class="lineNum">     922 </span>                : 
<span class="lineNum">     923 </span>                :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     924 </span>                :       // 438. Ambiguity in the &quot;do the right thing&quot; clause
<span class="lineNum">     925 </span>                :       template&lt;typename _Integer&gt;
<span class="lineNum">     926 </span>                :         void
<span class="lineNum">     927 </span>                :         _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
<span class="lineNum">     928 </span>                :         {
<span class="lineNum">     929 </span>                :           this-&gt;_M_impl._M_start = _M_allocate(static_cast&lt;size_type&gt;(__n));
<span class="lineNum">     930 </span>                :           this-&gt;_M_impl._M_end_of_storage =
<span class="lineNum">     931 </span>                :             this-&gt;_M_impl._M_start + static_cast&lt;size_type&gt;(__n);
<span class="lineNum">     932 </span>                :           _M_fill_initialize(static_cast&lt;size_type&gt;(__n), __value);
<span class="lineNum">     933 </span>                :         }
<span class="lineNum">     934 </span>                : 
<span class="lineNum">     935 </span>                :       // Called by the range constructor to implement [23.1.1]/9
<span class="lineNum">     936 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">     937 </span>                :         void
<span class="lineNum">     938 </span>                :         _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
<span class="lineNum">     939 </span>                :                                __false_type)
<span class="lineNum">     940 </span>                :         {
<span class="lineNum">     941 </span>                :           typedef typename std::iterator_traits&lt;_InputIterator&gt;::
<span class="lineNum">     942 </span>                :             iterator_category _IterCategory;
<span class="lineNum">     943 </span>                :           _M_range_initialize(__first, __last, _IterCategory());
<span class="lineNum">     944 </span>                :         }
<span class="lineNum">     945 </span>                : 
<span class="lineNum">     946 </span>                :       // Called by the second initialize_dispatch above
<span class="lineNum">     947 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">     948 </span>                :         void
<span class="lineNum">     949 </span>                :         _M_range_initialize(_InputIterator __first,
<span class="lineNum">     950 </span>                :                             _InputIterator __last, std::input_iterator_tag)
<span class="lineNum">     951 </span>                :         {
<span class="lineNum">     952 </span>                :           for (; __first != __last; ++__first)
<span class="lineNum">     953 </span>                :             push_back(*__first);
<span class="lineNum">     954 </span>                :         }
<span class="lineNum">     955 </span>                : 
<span class="lineNum">     956 </span>                :       // Called by the second initialize_dispatch above
<span class="lineNum">     957 </span>                :       template&lt;typename _ForwardIterator&gt;
<span class="lineNum">     958 </span>                :         void
<span class="lineNum">     959 </span>                :         _M_range_initialize(_ForwardIterator __first,
<span class="lineNum">     960 </span>                :                             _ForwardIterator __last, std::forward_iterator_tag)
<span class="lineNum">     961 </span>                :         {
<span class="lineNum">     962 </span>                :           const size_type __n = std::distance(__first, __last);
<span class="lineNum">     963 </span>                :           this-&gt;_M_impl._M_start = this-&gt;_M_allocate(__n);
<span class="lineNum">     964 </span>                :           this-&gt;_M_impl._M_end_of_storage = this-&gt;_M_impl._M_start + __n;
<span class="lineNum">     965 </span>                :           this-&gt;_M_impl._M_finish =
<span class="lineNum">     966 </span>                :             std::__uninitialized_copy_a(__first, __last,
<span class="lineNum">     967 </span>                :                                         this-&gt;_M_impl._M_start,
<span class="lineNum">     968 </span>                :                                         _M_get_Tp_allocator());
<span class="lineNum">     969 </span>                :         }
<span class="lineNum">     970 </span>                : 
<span class="lineNum">     971 </span>                :       // Called by the first initialize_dispatch above and by the
<span class="lineNum">     972 </span>                :       // vector(n,value,a) constructor.
<span class="lineNum">     973 </span>                :       void
<span class="lineNum">     974 </span>                :       _M_fill_initialize(size_type __n, const value_type&amp; __value)
<span class="lineNum">     975 </span>                :       {
<span class="lineNum">     976 </span>                :         std::__uninitialized_fill_n_a(this-&gt;_M_impl._M_start, __n, __value, 
<span class="lineNum">     977 </span>                :                                       _M_get_Tp_allocator());
<span class="lineNum">     978 </span>                :         this-&gt;_M_impl._M_finish = this-&gt;_M_impl._M_end_of_storage;
<span class="lineNum">     979 </span>                :       }
<span class="lineNum">     980 </span>                : 
<span class="lineNum">     981 </span>                : 
<span class="lineNum">     982 </span>                :       // Internal assign functions follow.  The *_aux functions do the actual
<span class="lineNum">     983 </span>                :       // assignment work for the range versions.
<span class="lineNum">     984 </span>                : 
<span class="lineNum">     985 </span>                :       // Called by the range assign to implement [23.1.1]/9
<span class="lineNum">     986 </span>                : 
<span class="lineNum">     987 </span>                :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     988 </span>                :       // 438. Ambiguity in the &quot;do the right thing&quot; clause
<span class="lineNum">     989 </span>                :       template&lt;typename _Integer&gt;
<span class="lineNum">     990 </span>                :         void
<span class="lineNum">     991 </span>                :         _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
<span class="lineNum">     992 </span>                :         { _M_fill_assign(__n, __val); }
<span class="lineNum">     993 </span>                : 
<span class="lineNum">     994 </span>                :       // Called by the range assign to implement [23.1.1]/9
<span class="lineNum">     995 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">     996 </span>                :         void
<span class="lineNum">     997 </span>                :         _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
<span class="lineNum">     998 </span>                :                            __false_type)
<span class="lineNum">     999 </span>                :         {
<span class="lineNum">    1000 </span>                :           typedef typename std::iterator_traits&lt;_InputIterator&gt;::
<span class="lineNum">    1001 </span>                :             iterator_category _IterCategory;
<span class="lineNum">    1002 </span>                :           _M_assign_aux(__first, __last, _IterCategory());
<span class="lineNum">    1003 </span>                :         }
<span class="lineNum">    1004 </span>                : 
<span class="lineNum">    1005 </span>                :       // Called by the second assign_dispatch above
<span class="lineNum">    1006 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">    1007 </span>                :         void
<span class="lineNum">    1008 </span>                :         _M_assign_aux(_InputIterator __first, _InputIterator __last,
<span class="lineNum">    1009 </span>                :                       std::input_iterator_tag);
<span class="lineNum">    1010 </span>                : 
<span class="lineNum">    1011 </span>                :       // Called by the second assign_dispatch above
<span class="lineNum">    1012 </span>                :       template&lt;typename _ForwardIterator&gt;
<span class="lineNum">    1013 </span>                :         void
<span class="lineNum">    1014 </span>                :         _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
<span class="lineNum">    1015 </span>                :                       std::forward_iterator_tag);
<span class="lineNum">    1016 </span>                : 
<span class="lineNum">    1017 </span>                :       // Called by assign(n,t), and the range assign when it turns out
<span class="lineNum">    1018 </span>                :       // to be the same thing.
<span class="lineNum">    1019 </span>                :       void
<span class="lineNum">    1020 </span>                :       _M_fill_assign(size_type __n, const value_type&amp; __val);
<span class="lineNum">    1021 </span>                : 
<span class="lineNum">    1022 </span>                : 
<span class="lineNum">    1023 </span>                :       // Internal insert functions follow.
<span class="lineNum">    1024 </span>                : 
<span class="lineNum">    1025 </span>                :       // Called by the range insert to implement [23.1.1]/9
<span class="lineNum">    1026 </span>                : 
<span class="lineNum">    1027 </span>                :       // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">    1028 </span>                :       // 438. Ambiguity in the &quot;do the right thing&quot; clause
<span class="lineNum">    1029 </span>                :       template&lt;typename _Integer&gt;
<span class="lineNum">    1030 </span>                :         void
<span class="lineNum">    1031 </span>                :         _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
<span class="lineNum">    1032 </span>                :                            __true_type)
<span class="lineNum">    1033 </span>                :         { _M_fill_insert(__pos, __n, __val); }
<span class="lineNum">    1034 </span>                : 
<span class="lineNum">    1035 </span>                :       // Called by the range insert to implement [23.1.1]/9
<span class="lineNum">    1036 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">    1037 </span>                :         void
<span class="lineNum">    1038 </span>                :         _M_insert_dispatch(iterator __pos, _InputIterator __first,
<span class="lineNum">    1039 </span>                :                            _InputIterator __last, __false_type)
<span class="lineNum">    1040 </span>                :         {
<span class="lineNum">    1041 </span>                :           typedef typename std::iterator_traits&lt;_InputIterator&gt;::
<span class="lineNum">    1042 </span>                :             iterator_category _IterCategory;
<span class="lineNum">    1043 </span>                :           _M_range_insert(__pos, __first, __last, _IterCategory());
<span class="lineNum">    1044 </span>                :         }
<span class="lineNum">    1045 </span>                : 
<span class="lineNum">    1046 </span>                :       // Called by the second insert_dispatch above
<span class="lineNum">    1047 </span>                :       template&lt;typename _InputIterator&gt;
<span class="lineNum">    1048 </span>                :         void
<span class="lineNum">    1049 </span>                :         _M_range_insert(iterator __pos, _InputIterator __first,
<span class="lineNum">    1050 </span>                :                         _InputIterator __last, std::input_iterator_tag);
<span class="lineNum">    1051 </span>                : 
<span class="lineNum">    1052 </span>                :       // Called by the second insert_dispatch above
<span class="lineNum">    1053 </span>                :       template&lt;typename _ForwardIterator&gt;
<span class="lineNum">    1054 </span>                :         void
<span class="lineNum">    1055 </span>                :         _M_range_insert(iterator __pos, _ForwardIterator __first,
<span class="lineNum">    1056 </span>                :                         _ForwardIterator __last, std::forward_iterator_tag);
<span class="lineNum">    1057 </span>                : 
<span class="lineNum">    1058 </span>                :       // Called by insert(p,n,x), and the range insert when it turns out to be
<span class="lineNum">    1059 </span>                :       // the same thing.
<span class="lineNum">    1060 </span>                :       void
<span class="lineNum">    1061 </span>                :       _M_fill_insert(iterator __pos, size_type __n, const value_type&amp; __x);
<span class="lineNum">    1062 </span>                : 
<span class="lineNum">    1063 </span>                :       // Called by insert(p,x)
<span class="lineNum">    1064 </span>                : #ifndef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">    1065 </span>                :       void
<span class="lineNum">    1066 </span>                :       _M_insert_aux(iterator __position, const value_type&amp; __x);
<span class="lineNum">    1067 </span>                : #else
<span class="lineNum">    1068 </span>                :       template&lt;typename... _Args&gt;
<span class="lineNum">    1069 </span>                :         void
<span class="lineNum">    1070 </span>                :         _M_insert_aux(iterator __position, _Args&amp;&amp;... __args);
<span class="lineNum">    1071 </span>                : #endif
<span class="lineNum">    1072 </span>                : 
<span class="lineNum">    1073 </span>                :       // Called by the latter.
<span class="lineNum">    1074 </span>                :       size_type
<span class="lineNum">    1075 </span><span class="lineCov">       11702598 :       _M_check_len(size_type __n, const char* __s) const</span>
<span class="lineNum">    1076 </span>                :       {
<span class="lineNum">    1077 </span><span class="lineCov">       11702598 :         if (max_size() - size() &lt; __n)</span>
<span class="lineNum">    1078 </span><span class="lineNoCov">              0 :           __throw_length_error(__N(__s));</span>
<span class="lineNum">    1079 </span>                : 
<span class="lineNum">    1080 </span><span class="lineCov">       23405196 :         const size_type __len = size() + std::max(size(), __n);</span>
<span class="lineNum">    1081 </span><span class="lineCov">       23405196 :         return (__len &lt; size() || __len &gt; max_size()) ? max_size() : __len;</span>
<span class="lineNum">    1082 </span>                :       }
<span class="lineNum">    1083 </span>                : 
<span class="lineNum">    1084 </span>                :       // Internal erase functions follow.
<span class="lineNum">    1085 </span>                : 
<span class="lineNum">    1086 </span>                :       // Called by erase(q1,q2), clear(), resize(), _M_fill_assign,
<span class="lineNum">    1087 </span>                :       // _M_assign_aux.
<span class="lineNum">    1088 </span>                :       void
<span class="lineNum">    1089 </span><span class="lineCov">            416 :       _M_erase_at_end(pointer __pos)</span>
<span class="lineNum">    1090 </span>                :       {
<span class="lineNum">    1091 </span><span class="lineCov">        7484312 :         std::_Destroy(__pos, this-&gt;_M_impl._M_finish, _M_get_Tp_allocator());</span>
<span class="lineNum">    1092 </span><span class="lineCov">        3742156 :         this-&gt;_M_impl._M_finish = __pos;</span>
<span class="lineNum">    1093 </span><span class="lineCov">            416 :       }</span>
<span class="lineNum">    1094 </span>                :     };
<span class="lineNum">    1095 </span>                : 
<span class="lineNum">    1096 </span>                : 
<span class="lineNum">    1097 </span>                :   /**
<span class="lineNum">    1098 </span>                :    *  @brief  Vector equality comparison.
<span class="lineNum">    1099 </span>                :    *  @param  x  A %vector.
<span class="lineNum">    1100 </span>                :    *  @param  y  A %vector of the same type as @a x.
<span class="lineNum">    1101 </span>                :    *  @return  True iff the size and elements of the vectors are equal.
<span class="lineNum">    1102 </span>                :    *
<span class="lineNum">    1103 </span>                :    *  This is an equivalence relation.  It is linear in the size of the
<span class="lineNum">    1104 </span>                :    *  vectors.  Vectors are considered equivalent if their sizes are equal,
<span class="lineNum">    1105 </span>                :    *  and if corresponding elements compare equal.
<span class="lineNum">    1106 </span>                :   */
<span class="lineNum">    1107 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1108 </span>                :     inline bool
<span class="lineNum">    1109 </span>                :     operator==(const vector&lt;_Tp, _Alloc&gt;&amp; __x, const vector&lt;_Tp, _Alloc&gt;&amp; __y)
<span class="lineNum">    1110 </span>                :     { return (__x.size() == __y.size()
<span class="lineNum">    1111 </span>                :               &amp;&amp; std::equal(__x.begin(), __x.end(), __y.begin())); }
<span class="lineNum">    1112 </span>                : 
<span class="lineNum">    1113 </span>                :   /**
<span class="lineNum">    1114 </span>                :    *  @brief  Vector ordering relation.
<span class="lineNum">    1115 </span>                :    *  @param  x  A %vector.
<span class="lineNum">    1116 </span>                :    *  @param  y  A %vector of the same type as @a x.
<span class="lineNum">    1117 </span>                :    *  @return  True iff @a x is lexicographically less than @a y.
<span class="lineNum">    1118 </span>                :    *
<span class="lineNum">    1119 </span>                :    *  This is a total ordering relation.  It is linear in the size of the
<span class="lineNum">    1120 </span>                :    *  vectors.  The elements must be comparable with @c &lt;.
<span class="lineNum">    1121 </span>                :    *
<span class="lineNum">    1122 </span>                :    *  See std::lexicographical_compare() for how the determination is made.
<span class="lineNum">    1123 </span>                :   */
<span class="lineNum">    1124 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1125 </span>                :     inline bool
<span class="lineNum">    1126 </span>                :     operator&lt;(const vector&lt;_Tp, _Alloc&gt;&amp; __x, const vector&lt;_Tp, _Alloc&gt;&amp; __y)
<span class="lineNum">    1127 </span>                :     { return std::lexicographical_compare(__x.begin(), __x.end(),
<span class="lineNum">    1128 </span>                :                                           __y.begin(), __y.end()); }
<span class="lineNum">    1129 </span>                : 
<span class="lineNum">    1130 </span>                :   /// Based on operator==
<span class="lineNum">    1131 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1132 </span>                :     inline bool
<span class="lineNum">    1133 </span>                :     operator!=(const vector&lt;_Tp, _Alloc&gt;&amp; __x, const vector&lt;_Tp, _Alloc&gt;&amp; __y)
<span class="lineNum">    1134 </span>                :     { return !(__x == __y); }
<span class="lineNum">    1135 </span>                : 
<span class="lineNum">    1136 </span>                :   /// Based on operator&lt;
<span class="lineNum">    1137 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1138 </span>                :     inline bool
<span class="lineNum">    1139 </span>                :     operator&gt;(const vector&lt;_Tp, _Alloc&gt;&amp; __x, const vector&lt;_Tp, _Alloc&gt;&amp; __y)
<span class="lineNum">    1140 </span>                :     { return __y &lt; __x; }
<span class="lineNum">    1141 </span>                : 
<span class="lineNum">    1142 </span>                :   /// Based on operator&lt;
<span class="lineNum">    1143 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1144 </span>                :     inline bool
<span class="lineNum">    1145 </span>                :     operator&lt;=(const vector&lt;_Tp, _Alloc&gt;&amp; __x, const vector&lt;_Tp, _Alloc&gt;&amp; __y)
<span class="lineNum">    1146 </span>                :     { return !(__y &lt; __x); }
<span class="lineNum">    1147 </span>                : 
<span class="lineNum">    1148 </span>                :   /// Based on operator&lt;
<span class="lineNum">    1149 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1150 </span>                :     inline bool
<span class="lineNum">    1151 </span>                :     operator&gt;=(const vector&lt;_Tp, _Alloc&gt;&amp; __x, const vector&lt;_Tp, _Alloc&gt;&amp; __y)
<span class="lineNum">    1152 </span>                :     { return !(__x &lt; __y); }
<span class="lineNum">    1153 </span>                : 
<span class="lineNum">    1154 </span>                :   /// See std::vector::swap().
<span class="lineNum">    1155 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1156 </span>                :     inline void
<span class="lineNum">    1157 </span>                :     swap(vector&lt;_Tp, _Alloc&gt;&amp; __x, vector&lt;_Tp, _Alloc&gt;&amp; __y)
<span class="lineNum">    1158 </span>                :     { __x.swap(__y); }
<span class="lineNum">    1159 </span>                : 
<span class="lineNum">    1160 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">    1161 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1162 </span>                :     inline void
<span class="lineNum">    1163 </span>                :     swap(vector&lt;_Tp, _Alloc&gt;&amp;&amp; __x, vector&lt;_Tp, _Alloc&gt;&amp; __y)
<span class="lineNum">    1164 </span>                :     { __x.swap(__y); }
<span class="lineNum">    1165 </span>                : 
<span class="lineNum">    1166 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">    1167 </span>                :     inline void
<span class="lineNum">    1168 </span>                :     swap(vector&lt;_Tp, _Alloc&gt;&amp; __x, vector&lt;_Tp, _Alloc&gt;&amp;&amp; __y)
<span class="lineNum">    1169 </span>                :     { __x.swap(__y); }
<span class="lineNum">    1170 </span>                : #endif
<span class="lineNum">    1171 </span>                : 
<span class="lineNum">    1172 </span>                : _GLIBCXX_END_NESTED_NAMESPACE
<span class="lineNum">    1173 </span>                : 
<span class="lineNum">    1174 </span>                : #endif /* _STL_VECTOR_H */
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
